<?php
use yii\helpers\Html;
use yii\helpers\ArrayHelper;
?>
<link href="/css/plugins/chosen/chosen.css" rel="stylesheet">
<!-- Sweet Alert -->
<link href="/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">

<style type="text/css">
    .has-success .text-danger{color: #1ab394;}
</style>

<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox">
                <div class="ibox-title">
                    <h5><?=Html::a('<i class="fa fa-angle-left"></i> 返回','javascript:history.go(-1);',['class'=>'btn btn-xs btn-white'])?> 编辑用户</h5>
                </div>
                <div class="ibox-content" style="padding-bottom: 300px">
                    <?= Html::beginForm('','post',['id' => 'login-form','class' => 'form-horizontal area-add-form'])?>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="text-danger">*</span>姓名：</label>
                            <div class="col-sm-3">
                                <?=Html::activeInput('text',$info, 'name',['class'=>'form-control']) ?>
                                <?=Html::error($info,'name',['class'=>'input_err'])?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="text-danger">*</span>工号：</label>
                            <div class="col-sm-3">
                                <?=Html::activeInput('text',$info, 'job_number',['class'=>'form-control']) ?>
                                <?=Html::error($info,'job_number',['class'=>'input_err'])?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="text-danger">*&nbsp;</span>角色：</label>
                            <div class="col-sm-2">
                                <?= Html::dropDownList('AdminModel[role_id]', $info->role_id?:'', [''=>'请选择角色']+$role_list,['class'=>'form-control class_id']) ?>
                                <?=Html::error($info,'role_id',['class'=>'input_err'])?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="text-danger">*&nbsp;</span>机构：</label>
                            <div class="col-sm-2">
                                <?= Html::dropDownList('AdminModel[organization_id]', $info->organization_id?:'', ['0'=>'请选择机构']+$org,['class'=>'form-control class_id']) ?>
                                <?=Html::error($info,'organization_id',['class'=>'input_err'])?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="text-danger">*</span>账户类型：</label>
                            <div class="col-sm-3">
                                <?=Html::radioList('AdminModel[account_type]',isset($info->account_type) ? $info->account_type : '',['1'=>'员工','2'=>'经销商','3'=>'机构','4'=>'代理商']);?>
                                <?=Html::error($info,'account_type',['class'=>'input_err'])?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="text-danger">*</span>手机：</label>
                            <div class="col-sm-3">
                                <?=Html::activeInput('text',$info, 'mobile',['class'=>'form-control']) ?>
                                <?=Html::error($info,'mobile',['class'=>'input_err'])?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="text-danger"></span>邮箱：</label>
                            <div class="col-sm-3">
                                <?=Html::activeInput('text',$info, 'email',['class'=>'form-control']) ?>
                                <?=Html::error($info,'email',['class'=>'input_err'])?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="text-danger"></span>民族：</label>
                            <div class="col-sm-3">
                                <?=Html::activeInput('text',$info, 'famous',['class'=>'form-control']) ?>
                                <?=Html::error($info,'famous',['class'=>'input_err'])?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="text-danger">*</span>性别：</label>
                            <div class="col-sm-3">
                                <?=Html::radioList('AdminModel[sex]',isset($info->sex) && $info->sex == 1 ? '1' : '2',['1'=>'男','2'=>'女']);?>
                                <?=Html::error($info,'sex',['class'=>'input_err'])?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="text-danger">*</span>年龄：</label>
                            <div class="col-sm-3">
                                <?=Html::activeInput('text',$info, 'age',['class'=>'form-control']) ?>
                                <?=Html::error($info,'age',['class'=>'input_err'])?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">身份证号：</label>
                            <div class="col-sm-3">
                                <?=Html::activeInput('text',$info, 'number',['class'=>'form-control']) ?>
                                <?=Html::error($info,'number',['class'=>'input_err'])?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">籍贯：</label>
                            <div class="col-sm-3">
                                <?=Html::activeInput('text',$info, 'native_place',['class'=>'form-control']) ?>
                                <?=Html::error($info,'native_place',['class'=>'input_err'])?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">身份证地址：</label>
                            <div class="col-sm-3">
                                <?=Html::activeInput('text',$info, 'card_address',['class'=>'form-control']) ?>
                                <?=Html::error($info,'card_address',['class'=>'input_err'])?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">现居住地：</label>
                            <div class="col-sm-3">
                                <?=Html::activeInput('text',$info, 'address',['class'=>'form-control']) ?>
                                <?=Html::error($info,'address',['class'=>'input_err'])?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">照片地址：</label>
                            <div class="col-sm-3">
                                <?=Html::activeInput('text',$info, 'image',['class'=>'form-control']) ?>
                                <?=Html::error($info,'image',['class'=>'input_err'])?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">紧急联系人的关系：</label>
                            <div class="col-sm-3">
                                <?=Html::activeInput('text',$info, 'emergency_relation',['class'=>'form-control']) ?>
                                <?=Html::error($info,'emergency_relation',['class'=>'input_err'])?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">紧急联系人：</label>
                            <div class="col-sm-3">
                                <?=Html::activeInput('text',$info, 'emergency_name',['class'=>'form-control']) ?>
                                <?=Html::error($info,'emergency_name',['class'=>'input_err'])?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">紧急联系人电话：</label>
                            <div class="col-sm-3">
                                <?=Html::activeInput('text',$info, 'emergency_tel',['class'=>'form-control']) ?>
                                <?=Html::error($info,'emergency_tel',['class'=>'input_err'])?>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-2">
                                <?=Html::submitButton('保存',['class'=>'btn btn-primary col-md-offset-2'])?>
                                <?=Html::a('返回','javascript:history.go(-1);',['class'=>'btn btn-white'])?>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

